package com.panfeng.xcloud.boss.provider.member.enums;

import lombok.Getter;

@Getter
public enum OperationTypeEnum {

    REG(1, "注册"),
    LOGIN(2, "登录"),
    ACCOUNT_SECURITY(3, "账号安全"),
    INFOUPDATE(4, "信息更改");

    private int code;
    private String message;

    private OperationTypeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public static String getMessageByCode(int code) {
        if ((code == 0)) {
            return "";
        }
        OperationTypeEnum[] values = values();
        for (OperationTypeEnum entry : values) {
            if (entry.getCode() == code) {
                return entry.getMessage();
            }
        }
        return "";
    }
}
